from django.shortcuts import render, HttpResponse, redirect

def self_login_required(func):
    def inner(request):
        is_login = request.session.get('is_login', False)
        if is_login:
            return func(request)
        else:
            return redirect("/login")
    return inner